package com.xlh.proxy.util;

import com.xlh.proxy.service.OrderService;
import com.xlh.proxy.service.TimerInvocationHandler;

import java.lang.reflect.Proxy;

public class ProxyUtil {
    //封装一个创建代理对象的方法
    public static Object newProxyInstance(Object target){
        return Proxy.newProxyInstance(target.getClass().getClassLoader(),
                        target.getClass().getInterfaces(),
                        new TimerInvocationHandler(target));
    }
}
